package org.bjf.springboot.init;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * 服务启动执行
 * 实现这个接口的类总是会被优先于spring启动(有误)
 * Created by binjinfeng on 2017/5/3.
 */
@Component
public class InitRunner implements CommandLineRunner {

  private static final Logger logger = LoggerFactory.getLogger(InitRunner.class);

  @Override
  public void run(String... strings) throws Exception {
    logger.info(
        "=========================================InitRunner.服务启动执行，执行加载数据等操作(run: before spring)=========================================");

    System.out.println();

  }
}
